home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / StdinWrite.au3 < prev    next >
Text File  |  2006-06-17  |  400b  |  12 lines

  1. ; Demonstrates the use of StdinWrite()
  2. #include <Constants.au3>
  3.  
  4. $foo = Run("sort.exe", @SystemDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD)
  5. ; Write string to be sorted to child sort.exe's STDIN
  6. StdinWrite($foo, "rat" & @CRLF & "cat" & @CRLF & "bat" & @CRLF)
  7. ; Calling with no 2nd arg closes stream
  8. StdinWrite($foo)
  9.  
  10. ; Read from child's STDOUT and show
  11. MsgBox(0, "Debug", StdoutRead($foo))
  12.